package blog.caidabao.controller;

import blog.caidabao.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("test")
public class TestController {
    @Autowired
    private RedisService redisService;

    @DeleteMapping("/deleteViewTimes/{id}")
    public ResponseEntity<Boolean> deleteArticleViewTimes(@PathVariable("id") Integer id){
        this.redisService.deleteArticle(id);
        return ResponseEntity.ok(true);
    }
}
